/*
============================================================================
Name        : eStockDocument.h
Author      : 王斌
Version     :
Copyright   : 益盟软件
Description : Application document class (model)
============================================================================
*/

#ifndef __ESTOCKDOCUMENT_H__
#define __ESTOCKDOCUMENT_H__

// INCLUDES
#include <akndoc.h>

// FORWARD DECLARATIONS
class CeStockAppUi;
class CEikApplication;
class CGprsTools;


// CLASS DECLARATION

/**
* CeStockDocument application class.
* An instance of class CeStockDocument is the Document part of the
* AVKON application framework for the eStock example application.
*/
class CeStockDocument : public CAknDocument
{
public: // Constructors and destructor

	/**
	* NewL.
	* Two-phased constructor.
	* Construct a CeStockDocument for the AVKON application aApp
	* using two phase construction, and return a pointer
	* to the created object.
	* @param aApp Application creating this document.
	* @return A pointer to the created instance of CeStockDocument.
	*/
	static CeStockDocument* NewL( CEikApplication& aApp );

	/**
	* NewLC.
	* Two-phased constructor.
	* Construct a CeStockDocument for the AVKON application aApp
	* using two phase construction, and return a pointer
	* to the created object.
	* @param aApp Application creating this document.
	* @return A pointer to the created instance of CeStockDocument.
	*/
	static CeStockDocument* NewLC( CEikApplication& aApp );

	/**
	* ~CeStockDocument
	* Virtual Destructor.
	*/
	virtual ~CeStockDocument();

public: // Functions from base classes

	/**
	* CreateAppUiL
	* From CEikDocument, CreateAppUiL.
	* Create a CeStockAppUi object and return a pointer to it.
	* The object returned is owned by the Uikon framework.
	* @return Pointer to created instance of AppUi.
	*/
	CEikAppUi* CreateAppUiL();

private: // Constructors

	/**
	* ConstructL
	* 2nd phase constructor.
	*/
	void ConstructL();

	/**
	* CeStockDocument.
	* C++ default constructor.
	* @param aApp Application creating this document.
	*/
	CeStockDocument( CEikApplication& aApp );

private:
	//解决CGprsTools对象作为CGlobal类成员，析构CeStockAppUi类时先delete CGlobal对象后
	//delete view时出现的kern-exec 0错误(RHTTPSession::Close()引起)
	//若将CGlobal对象作为Document成员，构造CGlobal对象时CompleteWithAppPath函数会报
	//kern—exec 3错误
	//故将CGprsTools对象单独从CGlobal类中提出作为Document成员
	CGprsTools* g_GprsTool;

};

#endif // __ESTOCKDOCUMENT_H__

// End of File
